package com.qf.cx.simplenms.webservice.model;

import com.qf.cx.simplenms.persist.entity.TagMemoryEntity;

public class TagMemory {
	private String name;
	private int bank;
	private int offset;
	private int length;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getBank() {
		return bank;
	}

	public void setBank(int bank) {
		this.bank = bank;
	}

	public int getOffset() {
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public static TagMemory from(TagMemoryEntity t) {
		TagMemory o = new TagMemory();
		o.bank = t.getBank();
		o.length = t.getLength();
		o.name = t.getName();
		o.offset = t.getOffset();
		return o;
	}

	public TagMemoryEntity toTagMemoryEntity() {
		TagMemoryEntity o = new TagMemoryEntity();
		o.setBank(bank);
		o.setLength(length);
		o.setName(name);
		o.setOffset(offset);
		return o;
	}

	@Override
	public String toString() {
		return "TagMemory [name=" + name + ", bank=" + bank + ", offset=" + offset + ", length=" + length + "]";
	}

}
